package ccg;

import java.io.*;

public class txt_toGBK {
    public static void main(String[] args) throws IOException {
        File[] files = new File("E:\\_黑马校对\\图片格式_caj").listFiles();
        for (File file : files){
            try {
                InputStream is = new FileInputStream(file);
                BufferedReader br = new BufferedReader(new InputStreamReader(is, "GBK"));//构造一个BufferedReader类来读取文件
                String s;
                while ((s = br.readLine()) != null) {//使用readLine方法，一次读一行
//                result.append(System.lineSeparator() + s);
//                System.out.println(s);
                }
                br.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
